var htmlplugin = require('html-webpack-plugin');
var vueplugin=require('vue-loader/lib/plugin');

module.exports={
  entry:'./src/main.js',//将要打包的文件
  output:{//出口
    filename:'build.js',
    path:__dirname+'/dist'//__dirname表示当前路径
  },
  mode:"none",
  module:{
    rules:[
      {//打包css文件
        test:/\.css$/,
        use:['style-loader','css-loader']
      },
      {//打包url文件
        test:/\.(png|jpg|gif|ttf|woff)$/,
        use:[{
          loader:'url-loader',
          options:{
            limit:20000//限制20k
          }
        }]
      },
      {
        test:/\.js$/,
        exclude:/node_modules/,
        use:[{
          loader:'babel-loader'
        }]
      },
      {
        test:/\.vue$/,
        use:["vue-loader"]
      }
    ]
  },
  plugins:[
    new htmlplugin({
      filename:'index.html',
      template:'./templates/html/index.html',
      title:'共享空间'
    }),
    new vueplugin()
  ]
}
